<template>
  <div class="gwc_container">
    <div class="main-div">
      <div class="header-div">
        <div class="logo-div">
          <img src="@/assets/images/logo.png" alt="无法加载图片" />
        </div>
      </div>
      <div class="body-div">
        <MyNav />
        <div class="location-div">
          <div class="parcel-div">
            <a href="./homePage.html">首页</a>
            <span>&nbsp;&nbsp;/&nbsp;&nbsp;</span>
            <a class="goods-link" href="#">购物车</a>
          </div>
        </div>
      </div>
      <div class="shopping-list">
        <div class="parcel-div">
          <div class="goods-column">
            <span>商品</span>
            <span>单价</span>
            <span>数量</span>
            <span>小计</span>
            <span>操作</span>
          </div>
          <ul></ul>
          <div class="settlement">
            <div class="settlement-detail">
              <div class="left-part">
                <input type="checkbox" id="allChoose" />
                <span>全选</span>
              </div>
              <div class="right-part">
                <div class="total-amount">
                  <span>共</span>
                  <span>0</span>
                  <span>件商品</span>
                </div>
                <div class="total-price">
                  <span>合计:</span>
                  <span>￥0.00</span>
                </div>
              </div>
            </div>
            <div class="settlement-btn">
              <button>结算</button>
            </div>
          </div>
          <div class="settlement-tip">
            <span>请选择商品</span>
          </div>
        </div>
      </div>
      <MyFooter />
      <MyBroad />
    </div>
  </div>
</template>

<script>
import MyFooter from '@/components/common/MyFooter.vue'
import MyNav from '@/components/common/MyNav.vue'
import MyBroad from '@/components/common/MyBroad.vue'
export default {
  name: 'gwc',
  components: {
    MyFooter,
    MyNav,
    MyBroad
  }
}
</script>

<style lang="less" scoped>
.location-div {
  top: 0;
  z-index: 1;
  position: sticky;
  background-color: #fff;
  border-top: 1px solid #dbdbdb;
  border-bottom: 1px solid #dbdbdb;
  a {
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
  }
  .parcel-div {
    width: 80%;
    margin: 0 auto;
    line-height: 40px;
  }
}

.shopping-list {
  height: 100vh;
  padding: 20px;
  display: flex;
  user-select: none;
  align-items: center;
  flex-direction: column;
  background-color: #f5f5f5;
  input {
    cursor: pointer;
  }
  .parcel-div {
    width: 1100px;
    position: relative;
    border: 1px solid #dbdbdb;
  }
  .goods-column {
    display: flex;
    line-height: 40px;
    text-align: center;
    background-color: #fff;
    span {
      width: 16%;
    }
    span:first-child {
      width: 36%;
    }
  }
  li {
    display: flex;
    padding: 10px 0;
    list-style: none;
    align-items: center;
    background-color: #fff;
    div {
      width: 16%;
      text-align: center;
    }
    div:first-child {
      width: 36%;
    }
  }
  .goods {
    font-size: 0;
    display: flex;
    justify-content: center;
    .check {
      width: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    img {
      width: 100px;
    }
    .detail {
      width: 150px;
      display: flex;
      text-align: left;
      flex-direction: column;
      span {
        line-height: 30px;
      }
      .goods-color {
        padding-left: 8px;
      }
    }
  }
  .amount {
    display: flex;
    align-items: center;
    justify-content: center;
    img {
      cursor: pointer;
    }
    span {
      width: 40px;
      display: inline-block;
    }
  }
  .subtotal span {
    font-size: 16px;
    font-weight: normal;
  }
  .operation {
    display: flex;
    justify-content: center;
    span {
      cursor: pointer;
    }
  }
  .settlement {
    display: flex;
    .settlement-detail {
      width: 80%;
      display: flex;
      justify-content: space-between;
      .left-part {
        display: flex;
        padding-left: 40px;
        align-items: center;
        span {
          padding: 0 10px;
        }
      }
      .right-part {
        display: flex;
        align-items: center;
        div {
          width: 150px;
        }
        .total-amount span:nth-child(2),
        .total-price span:nth-child(2) {
          color: #a10000;
        }
      }
    }
    .settlement-btn {
      width: 20%;
      button {
        width: 100%;
        height: 3em;
        border: none;
        color: #fff;
        cursor: pointer;
        transition: all 0.5s ease;
        background-color: #b3b3b3;
      }
    }
  }
  .settlement-tip {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    display: none;
    padding: 10px 15px;
    border-radius: 5px;
    position: absolute;
    width: fit-content;
    height: fit-content;
    transition: all 0.5s ease;
    background-color: rgba(0, 0, 0, 0.5);
    span {
      font-size: 18px;
      color: rgba(255, 255, 255, 0.8);
    }
  }
}

.active {
  color: #000;
}

.activeCheck {
  color: #000;
}

/********************* header *********************/
.header-div {
  .top-div::after {
    content: '';
    clear: both;
    display: block;
  }
  .top-div .logo-div {
    float: left;
    width: 400px;
    height: 140px;
    background-size: 35%;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url('@/assets/images/logo.png');
  }
  .top-div .nav-div {
    float: right;
    display: flex;
    padding: 70px 50px 0px;
  }
  .top-div .text-div {
    font-size: 20px;
    padding: 0 20px;
    line-height: 50px;
    text-align: center;
    color: rgba(0, 0, 0, 0.7);
  }
  .top-div form {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, 0.8);
  }
  .top-div form input:first-child {
    width: 80%;
    border: none;
    height: 2.5em;
    outline: none;
    font-size: 20px;
    background-size: 25px;
    padding: 5px 0px 5px 10px;
  }
  .top-div form input:last-child {
    width: 20%;
    border: none;
    cursor: pointer;
    background-color: #fff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 50%;
    background-image: url('@/assets/images/ss.png');
  }
  .top-div .a-img-div {
    display: flex;
    padding: 0 20px;
    position: relative;
    align-items: center;
    justify-content: center;
  }
  .top-div .a-img-div a {
    margin: 0 10px;
  }
  .top-div .a-img-div a img {
    width: 1.5em;
  }
}

.logo-div {
  float: left;
  margin-top: 2%;
  margin-bottom: 1%;
}

.header-div {
  width: 80%;
  margin: 0 auto;
}

.header-div::after {
  content: '';
  clear: both;
  display: block;
}
</style>
